from rest_framework.viewsets import ModelViewSet
from books.models import BookInfo,HeroInfo
from .serializers import HeroInfoSerializer,HeroInfoSerializer2,HeroInfoSerializer3,HeroInfoSerializer4




""" 第一种和第二种 """
class HeroInfoModelViewSet(ModelViewSet):
    queryset = HeroInfo.objects.all()
    serializer_class = HeroInfoSerializer


""" 第三种方法 """
class HeroInfoModelViewSet2(ModelViewSet):
    queryset = HeroInfo.objects.all()
    serializer_class = HeroInfoSerializer2


""" 第四种方法 """
class HeroInfoModelViewSet3(ModelViewSet):
    queryset = HeroInfo.objects.all()
    serializer_class = HeroInfoSerializer3



""" 第五种方法 """
class HeroInfoModelViewSet4(ModelViewSet):
    queryset = HeroInfo.objects.all()
    serializer_class = HeroInfoSerializer4